<template>
  <button @click="test">测试</button>
  <button @click="getUser">获取</button>
   <div class="test">我是测试文字</div>
</template>

<script>
import { useStore } from 'vuex'
export default {
  setup () {
    const store = useStore()
    const test = () => {
      store.commit('user/setUserId')
    }
    const getUser = () => {
      console.log(store.state.user.profile.id)
    }
    return {
      test,
      getUser
    }
  }
}
</script>

<style lang="less">
// @import "~@/styles/variables.less";
.test {
    color: @xtxColor;
}
</style>